<!DOCTYPE html>

<!--
  ~ Electronic Logistics Management Information System (eLMIS) is a supply chain management system for health commodities in a developing country setting.
  ~
  ~ Copyright (C) 2015  John Snow, Inc (JSI). This program was produced for the U.S. Agency for International Development (USAID). It was prepared under the USAID | DELIVER PROJECT, Task Order 4.
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Affero General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<script id="template/accordion/accordion.html" type="text/ng-template">
    <div class="accordion" ng-transclude></div>
</script>

<script id="template/accordion/accordion-group.html" type="text/ng-template">
    <div class="accordion-group">
        <div class="accordion-heading" style="margin-bottom:0; border-bottom:0">
            <a style="bottom:0" class="accordion-toggle" ng-class="{'collapsed':!isOpen,'open':isOpen}" ng-click="isOpen = !isOpen" accordion-transclude="heading">{{heading}}</a>
        </div>
        <div class="accordion-body" style="display:block; margin-bottom:0" collapse="!isOpen">

            <div class="accordion-inner" ng-transclude></div>  </div>
    </div>
</script>
<div class="row-fluid sortable ui-sortable">
    <div class="box span12">

        <ng-include src="'/public/pages/dashboard/shared/dashboard-form.html'"></ng-include>
        <ng-include src="'/public/pages/dashboard/shared/alerts.html'"></ng-include>

        <table class="table table-bordered" ng-show="data == undefined || data.length == 0">
            <tr>
                <td>No data to show under selected filters</td>
            </tr>
        </table>
        <table ng-show="datarows.length > 0" class="table-bordered table table-striped pull-right" ng-table="tableParams" >
            <tbody >
            <tr ng-repeat="row in datarows">
                <td data-title="'#'" class="number" style="width:20px" >{{ row.no }}</td>
                <td data-title="'Facility Code'" style="width:150px" sortable="code" >{{ row.code }}</td>
                <td data-title="'Facility Name'" style="width:30%" sortable="name">{{ row.name }}</td>
                <td class="number" data-title="'Facility Authorization(Days)'" style="width:30%" >{{ row.subToAuth | number }}</td>
                <td class="number" data-title="'District Review(Days)'" style="width:30%" >{{ row.authToInApproval | number }}</td>
                <td class="number" data-title="'LMU Review(Days)'" style="width:30%" >{{ row.inApprovalToApproved | number }}</td>
                <td class="number" data-title="'Release order into E9(Days)'" style="width:30%" >{{ row.approvedToReleased | number }}</td>
                <td class="number" data-title="'Average Lead Time(Days)'" style="width:30%" >{{ row.subToAuth+row.authToInApproval+ row.inApprovalToApproved+ row.approvedToReleased  | number }}</td>
            </tr>
            </tbody>
        </table>

    </div>
</div>
